<div class="gt_post_comment_wrap gt_detail_hdg">
    <h5>评论
        <div style="float: right;padding-right: 40px"><h6>已有<span><a style="color: #ef3838;" class="count" href="${base}/comment.jspx?contentId=${content.id}">${content.commentsCheckedNum!} </a></span>条</h6></div>
    </h5>
    [#if content.channel.commentControl==0 || ((content.channel.commentControl==1||content.channel.commentControl==3))]
    <form class="gt_contact_form" id="commentForm" action="${base}/comment.jspx" method="post">
        <div class="col-md-12">
            <div class="gt_contact_us_field">
                  <textarea class="gt_c_bg" name="text" id="comments-text" placeholder="请发表你此时的观点和想法..." required=""></textarea>
            </div>
        </div>
        [#if user??&&user.group.needCaptcha||!user??]
        <div class="col-md-6">
            <div class="gt_contact_us_field">
                <input name="captcha" type="text" placeholder="验证码" id="captcha" vld="{required:true}"class="c_ph" />
            </div>
        </div>
        <div class="col-md-6">
            <div class="gt_contact_us_field">
                <img id="commentCaptcha" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()*1"/>
            </div>
        </div>
        <div class="col-md-12">
            <div class="gt_contact_us_field">
                <input type="hidden" name="contentId" value="${content.id}"/>
                <input type="hidden" name="sessionId" id="sessionId"/>
                <input type="submit" value="提交评论" class="submit-on">
            </div>
            <!--Alert Message-->
            <div id="contact-result"></div>
        </div>
        [/#if]
    </form>
    <script type="text/javascript">
        $(function () {
            $("#sessionId").val($.cookie("JSESSIONID"));
            Cms.comment(function (data) {
                if (data.status == 0) {
                    alert("评论成功");
                    location.href = location.href;
                } else if (data.status == 1) {
                    alert("验证码错误");
                    $("#commentCaptcha").click();
                } else if (data.status == 2) {
                    alert("内容不存在");
                    $("#commentCaptcha").click();
                } else if (data.status == 3) {
                    alert("评论关闭");
                    $("#commentCaptcha").click();
                } else if (data.status == 4) {
                    alert("需要登录评论");
                    $("#commentCaptcha").click();
                    location.href = "${base}/login.jspx";
                } else if (data.status == 5) {
                    alert("已经评论过，不能重复评论");
                    $("#commentCaptcha").click();
                } else if (data.status == 100) {
                    alert("内容不存在");
                    $("#commentCaptcha").click();
                } else if (data.status == 101) {
                    alert("评论不能为空");
                    $("#commentCaptcha").click();
                } else if (data.status == 10) {
                    alert("内容含有敏感词,不允许发表!");
                    $("#commentCaptchaCsi").click();
                } else if (data.status == 6) {
                    alert("超过今日发表评论限制!");
                    $("#commentCaptchaCsi").click();
                } else {
                    alert("评论失败");
                    $("#commentCaptcha").click();
                }
            });
        });
    </script>
    [#elseif content.channel.commentControl==1 && !user??]
    [#--登录评论，且未登录--]
    <div class="down clearfix">
        <img src="/${res}/extra-images/userImg.png" class="userImg">
        <span><a href="${base}/login.jspx?returnUrl=/">登录</a>之后才能发表评论</span>
    </div>
    [#else]
    [#--不允许评论--]
    [/#if]
</div>